package com.yinian.server.mapper;

import com.yinian.pojo.dto.UserUpdateInformationDTO;
import com.yinian.pojo.entity.User;
import com.yinian.pojo.vo.UserRegisterVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

     void updateUserInformation(UserUpdateInformationDTO userUpdateInformationDTO);

    /**
     * 根据用户名查询用户
     * @param email
     * @return
     */
    @Select("select * from user where e_mail = #{email}")
    User getByEmail(String email);

    /**
     * 根据邮箱查找用户
     * */
    @Select("select * from user where e_mail = #{email}")
    User selectByEmail(String email);

    @Insert("insert into user(username,password,e_mail) " +
            "values(#{userName},#{password},#{email})")
    void insertUser(User user);

}
